package ca.usask.cs.drawTree;

import ca.usask.cs.decisiontree.api.Edge;

public class TerNode extends TheNode {
	private DrawControler parent;
	private Edge sourceEdge;
	private double rollBackValue;
	private String variableName;
	private double time;
	private boolean selected;
	private int treeNodeID;
	private String NodeType = "TerminalNode";
	
//	int nodetriangleColor = 0xffCC33CC;
	
	int nodetriangleColor = 0xffCC33CC;

	TerNode(DrawControler dp, float ix, float iy, float ir, int Nodetype) {
		super(dp, ix, iy, ir, Nodetype);
		// TODO Auto-generated constructor stub
		parent = dp;
	}

	public void draw(float tx1, float ty1) {

		parent.fill(nodetriangleColor);
		parent.triangle(tx1, ty1, tx1 + 10, ty1 - 8, tx1 + 10, ty1 + 8);
	}
	public void changeColor(int color ) {
		nodetriangleColor = color;
	}
	
	public void colorBack(){
		nodetriangleColor = 0xffCC33CC;
	}
	
	
	public void setSourceEdge(Edge isourceEdge){
		this.sourceEdge = isourceEdge;
	}
	public void setRollBackValue(double irollBackValue){
		this.rollBackValue = irollBackValue;
	}
	public void setVariableName(String iName){
		this.variableName = iName;
	}
	public void setTreeNodeID(int iID){
		this.treeNodeID = iID;
	}
	public void setTime(double itime){
		this.time = itime;
	}

	public void setSelected(boolean iseleted){
		this.selected = iseleted;
	}
	
	
	public Edge getSourceEdge(){
		return this.sourceEdge;
	}
	public double getRollBackValue(){
		return this.rollBackValue;
	}
	public String getVariableName(){
		return this.variableName;
	}
	public int getTreeNodeID(){
		return this.treeNodeID;
	}
	public double getTime(){
		return this.time;
	}
	public boolean getSelected(){
		return this.selected;
	}
	public String getNodeType(){
		return this.NodeType;
	}
}
